package com.chaopei.day03;

/**
 * @Author Corday 天涯
 * @Date 2022/3/7 10:49
 * 终态类只能创建对象,不能继承
 */
public final class BigPie {
   private String name;
   private  double price;
   public BigPie(){}

    public BigPie(String name, double price) {
        this.name = name;
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
//    方法的重载的多态
    public  String getInfo(String name){
       return  "按名称查询!";
    }
    public String getInfo(String name,double price){
       return "按名称与价格查询!";
    }
    public String getInfo(double price){
       return "按价格查询!";
    }
}
